<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="include/base.jsp" %>
<html lang="zh-CN">
<head>
	<meta charset="UTF-8">
	<title>凯盛项目管理系统</title>
	<link rel="stylesheet" href="../css/bootstrap.min.css">
	<link rel="stylesheet" href="../css/bootstrap-responsive.css">
	<link rel="stylesheet" href="../css/docs.css">
	<script type="text/javascript" src="../js/jquery.js"></script>
	<script type="text/javascript" src="../js/bootstrap.min.js"></script>
</head>
<body class="body">
	<% pageContext.setAttribute("left", "contact"); %>
	<%@ include file="include/top.jsp" %>
	
	
	<div class="container">
	  <div class="row">
		<%@ include file="include/left.jsp" %>
		<div class="span9">
			
			<ul class="breadcrumb" style="margin-bottom:0px;border-radius: 3px 3px 0 0">
				<li class="active">
					<a href="task.html"><i class="icon-user"></i>联系人</a>
				</li>
			</ul>
			<div class="wall">
				
					
						<address>
							<h3>${contact.contactname }</h3>
							<p>${contact.company }</p>
							<small>手机</small> ${contact.tel }<br/>
							<small>固话</small>${contact.fixedtel }<br/><br/>
							<small>邮箱</small> ${contact.mail }<br/>
							<small>地址</small> ${contact.address }<br/><br/>
							<small>主页</small> <a href="http://www.kaishengit.com">${contact.homepage }</a><br/>
							<small>微博</small> <a href="https://twitter.com/fankay">${contact.blogname }</a><br/>
						</address>
						<div class="line">记录</div>
						<div>
							<textarea class="span5" rows="3"id = "content"></textarea>
							<br/>
							<button id = "Release"contactId = "${contact.id}">发布</button>
						</div>
						<div id = "replace">
						<c:forEach var = "record" items = "${contact.records}">
						
						<blockquote>
						  ${record.content }
						  <small>${record.createtime }</small>
						</blockquote>
						
						</c:forEach>
						</div>
						<a href="contactinformationdisplay.jspx">←返回联系人列表</a>
			</div>
			
			
			
		</div>
	  </div>
	</div>
	<script type="text/template" id="template">
		<blockquote>
			{{content}}
			<small>{{createtime}}</small>
		</blockquote>


	</script>
	
	
	<script type="text/javascript">
		$(function(){
			$("#Release").click(function(){
			
				$.ajax({
					data:{contactid:$(this).attr("contactId")},
					type:"get",
					url:"insertrecord.jspx?content="+encodeURIComponent($("#content").val()),
					success:function(data){
					var html = "";
						for(var i = 0;i < data.length;i++){
							template = document.getElementById("template").innerHTML;
							html = html + template.replace(/{{content}}/g,data[i].content).replace(/{{createtime}}/g,data[i].createtime);
						}
						$("#replace").html(html);
						
					},
				
				});
			
			});
		
		});
	
	
	
	
	
	
	
	
	</script>
	
	
	
	
	
	
	
</body>
</html>